home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_e_h / fc_20k.zip / WWWMENUS.DL_ < prev    next >
Text File  |  1992-11-06  |  31KB  |  815 lines

  1. ; WWWMENUS.DLL
  2. ; Common menus used by WWW Products
  3.  
  4.     CancelCmd="Exit"
  5.     goto %param1%        ; Go immediately to desired section
  6.                          ; Defined sections are:
  7.                               ZIP
  8.                               UNZIP
  9.                               SYSINFO
  10.                               INIEDIT
  11.                               FONEBOOK
  12.                               DIRSIZE
  13.                               FILEINFO
  14.                               FREESPACE
  15.                               CMDSTACK
  16.                               PROGBUILD
  17.                               WALLPAPER
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. :WALLPAPER
  20.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  21.            if FileExtension(a)=="BMP" then goto walldoit
  22.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  23.            if a!="" then goto sel
  24.  
  25.            ; Hmmm cannot find any BMP in current dir.  Check INI/Prompt user for info
  26.            WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  27.            :REASK
  28.            if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0))
  29.                               else WallDir=WallDir1
  30.            ErrorMode(@off)
  31.            DirChange(WallDir)
  32.            ErrorMode(@cancel)
  33.            a=FileItemize("*.BMP")
  34.            if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%")
  35.                     then goto REASK
  36.            if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI")
  37.  
  38.            :sel
  39.            a=strcat("-None- ",a)
  40.            a=ItemSelect("Select New Wallpaper",a," ")
  41.            terminate(a=="","Wallpaper","No wallpaper selected")
  42.            if a=="-None-" then Wallpaper("",0)
  43.                           then exit
  44.            a=strcat(DirGet(),a)
  45.            :walldoit
  46.            tile=@FALSE
  47.            if FileSize(a)<40000 then tile=@TRUE
  48.            ;if bmp size less than 40K, assume tile, else center
  49.            Wallpaper(a,tile)
  50.            drop(a,b,tile)
  51.            Exit
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. :PROGBUILD
  54.     ;Uses DDE to get ProgMan to divluge contents of groups and builds
  55.     ;CmdPost and File Commander menu items to match
  56.  
  57.     CancelCmd="goto cancelbuild"
  58.     startpm = 0
  59.  
  60.     OldWinTitle=WinName()
  61.     WinTitle("","Prog Build Initializing")
  62.     f=0
  63.     Pause("Progman Capture","This menu item will rebuild this menu file%cr%with the current contents of ProgMan groups.%cr%It does take a few minutes, so be patient.")
  64.     ProgWho=""
  65.     If stricmp("FileCmdr",param2)==0 then ProgWho="FC"
  66.                                      then OldWinTitle="File Manager"
  67.     If stricmp("CmdPost",param2)==0  then ProgWho="CP"
  68.     Terminate(ProgWho=="","ProgBuild Menu Error","Param2 not CP or FC")
  69.  
  70.     LSP=""
  71.     if ProgWho=="CP" then newcpm = "cmdgroup.cpm"
  72.                      then LSP=" "
  73.     if ProgWho=="FC" then newcpm = "wwwfc4.mnu"
  74.     n=FileLocate(newcpm)
  75.     if n=="" then newcpm=strcat(DirWindows(0),newcpm)
  76.              else newcpm=n
  77.  
  78.     channel = DDEInitiate("Progman", "Progman")
  79.     If channel != 0 Then Goto DDEOK
  80.     ; Hmmm DDE not working.  Check for Progman
  81.     If WinExist("Program Manager") then Goto TRY2
  82.     If !FileExist("progman.exe") then Message("ProgMan Capture","Cannot find PROGMAN.EXE")
  83.                                  then goto cancelbuild
  84.     RunHide("progman.exe", "")
  85.     startpm=1
  86.   :TRY2
  87.     channel = DDEInitiate("Progman", "Progman")
  88.     If channel == 0 Then Goto ddeerror
  89.   :DDEOK
  90.     groups = DDERequest(channel, "Groups")
  91.     If groups == "***NACK***" Then Goto ddeerror
  92.     groups = StrReplace(groups, cr, tab)
  93.     groups = ItemSort(groups, tab)
  94.     f = FileOpen(newcpm, "WRITE")
  95.     if ProgWho=="CP" then FileWrite(f,"&Groups")
  96.                      then FileWrite(f," Rebuild Menu from ProgMan Grps")
  97.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  98.     if ProgWho=="FC" then FileWrite(f,"Rebuild Menu from ProgMan Grps")
  99.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  100.     n = ItemCount(groups, tab)
  101.     i = 0
  102.  
  103.   :nextgroup
  104.     i = i + 1
  105.     group = strtrim(ItemExtract(i, groups, tab))
  106.     If group == "" Then Goto DODANEXTONE
  107.     If group=="Quick Access" then goto DODANEXTONE
  108.  
  109.     FirstItem=0
  110.     if i==1 then GroupTitle=strcat(LSP,"_",group)
  111.             then goto notfirstgrp
  112.  
  113.     if ((i mod 18) == 1) then GroupTitle=strcat(LSP,"|",group)
  114.                          else GroupTitle=strcat(LSP,group)
  115.  
  116.     :notfirstgrp
  117.     items = DDERequest(channel, group)
  118.     If items == "***NACK***" Then Goto DODANEXTONE
  119.     items = StrReplace(items, cr, tab)
  120.     items = ItemRemove(1, items, tab)
  121.     items = ItemSort(items, tab)
  122.  
  123.     o = ItemCount(items, tab)
  124.     j = 0
  125.   :nextitem
  126.     j = j + 1
  127.     item = ItemExtract(j, items, tab)
  128.     If item == "" Then Goto DODANEXTONE
  129.  
  130.     itemdesc = strtrim(ItemExtract(1, item, ","))
  131.     itemdesc = StrSub(itemdesc, 2, StrLen(itemdesc) - 2)
  132.  
  133.     itemprog = StrLower(strtrim(ItemExtract(2, item, ",")))
  134.     itemprog = StrSub(itemprog, 2, StrLen(itemprog) - 2)
  135.     WinTitle("",`<Group %group% %i%/%n% : Item %itemprog% %j%/%o%>`)
  136.     itemparms = ""
  137.     sp1 = StrIndex(itemprog, " ", 1, @FWDSCAN)
  138.     If sp1 == 0 Then Goto noparms
  139.     itemparms = StrSub(itemprog, sp1 + 1, StrLen(itemprog) - sp1)
  140.     itemprog = StrSub(itemprog, 1, sp1 - 1)
  141.     :noparms
  142.  
  143.     itemdir = StrLower(strtrim(ItemExtract(3, item, ",")))
  144.  
  145.     ; Do HotKeys for CmdPost
  146.     hotkey = ""
  147.     if ProgWho!="CP" then goto nohotkey
  148.     itemkey = strtrim(ItemExtract(8, item, ","))
  149.     If itemkey == "0" Then Goto nohotkey
  150.     hotkey = " \ "
  151.     If itemkey & 1024 Then hotkey = StrCat(hotkey, "!")
  152.     If itemkey & 512 Then hotkey = StrCat(hotkey, "^")
  153.     If itemkey & 256 Then hotkey = StrCat(hotkey, "+")
  154.     hotkey = StrCat(hotkey, Num2Char(itemkey & 255))
  155.  
  156.     :nohotkey
  157.  
  158.     icon = ""
  159.     If strtrim(ItemExtract(9, item, ",")) == "1" Then icon = "Icon"
  160.  
  161.     if FirstItem==0 then FileWrite(f, GroupTitle)
  162.                     then FirstItem=1
  163.  
  164.     nit=""
  165.     if ( (j!=1) && ((j mod 15)==1)) then nit="|"
  166.     FileWrite(f, `%LSP% %nit%%itemdesc%%hotkey%`)
  167.     If itemdir != "" Then FileWrite(f, `       DirChange("%itemdir%")`)
  168.     FileWrite(f, `       Run%icon%("%itemprog%", "%itemparms%")`)
  169.     FileWrite(f, ``)
  170.  
  171.  
  172.     :DODANEXTONE
  173.     If j < o Then Goto nextitem
  174.     If i < n Then Goto nextgroup
  175.     Goto pbdone
  176.  
  177.     :error
  178.     Message("ProgMan Group Capture Error", "Operation unsuccessful")
  179.     Goto cancelbuild
  180.  
  181.     :ddeerror
  182.     Message("ProgMan Group Capture DDE Error", "Operation unsuccessful")
  183.     Goto cancelbuild
  184.  
  185.     :pbdone
  186.     Message("ProgMan Group Capture", "Processing complete%cr%Push OK and wait for menu reload.")
  187.  
  188.     :cancelbuild
  189.     if f!=0 then FileClose(f)
  190.     If IsDefined(channel) Then DDETerminate(channel)
  191.     If startpm == 1 Then WinClose("Program Manager")
  192.     WinTitle("",OldWinTitle)
  193.     Drop(newcpm, startpm, channel, f, i, j, n, o, groups, group, items, item)
  194.     Drop(itemdesc, itemprog, itemparms, itemdir, itemkey, hotkey, icon, sp1)
  195.     Drop(OldWinTitle,GroupTitle,FirstItem)
  196.     Reload()
  197.     Exit
  198. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  199. :CMDSTACK
  200.         ; CmdStack uses wierd variable names to reduce the chance that a user
  201.         ; will try to execute a statement using the same names!!
  202.         if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  203.         if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  204.         goto %param2%
  205.  
  206.    :PREVIOUS
  207.         If CMDSTK987Cmds == "" Then Goto NEWCMD
  208.         CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, tab)
  209.         If CMDSTK987Now != "" Then Goto CMDDOIT
  210.    :NEWCMD
  211.         CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  212.         If CMDSTK987Now == "" Then Goto PREVIOUS
  213.    :CMDDOIT
  214.         Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  215.         if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,tab) then goto PREVIOUS
  216.         a=tab
  217.         if CMDSTK987Cmds=="" then a=""
  218.         CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  219.         CMDSTK987Last = CMDSTK987Now
  220.         Goto PREVIOUS
  221.  
  222.    :FLUSH
  223.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  224.       Exit
  225. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  226. :FREESPACE
  227.         Drives=DiskScan(2)     ; 2 is the code for local hard drives
  228.         Dmax=strlen(Drives)
  229.         DIndex=1
  230.         TotalSize=0
  231.         DriveReport=""
  232.  
  233.         :COUNTSPACE
  234.         NextDrive=StrSub(Drives,Dindex,1)
  235.         a=DiskFree(NextDrive)/1024
  236.         TotalSize=a+TotalSize
  237.         DriveReport=strcat(DriveReport,NextDrive," = ",TAB,a,"K",TAB,strfill("|",(a+500)/1000),"@")
  238.         DIndex=Dindex+3  ;each entry is 3 bytes long
  239.         if DIndex<=Dmax then goto COUNTSPACE
  240.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  241.         Drop(TotalSize,DriveReport,Drives,NextDrive)
  242.         Exit
  243. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  244. :FILEINFO
  245.         CancelCmd="goto cancelfi"
  246.         a=FileItemize("")
  247.         if a=="" then a=FileItemize("*.*")
  248.         tot=FileSize(a)
  249.         c=ItemCount(a," ")
  250.         n=0
  251.         b=""
  252.         :ffloop
  253.         if n==c then goto ffshow
  254.         n=n+1
  255.         a1=StrFix(ItemExtract(n,a," ")," ",14)
  256.         a2=FileSize(a1)
  257.         a3=FileTimeGet(a1)
  258.         a4=FileAttrGet(a1)
  259.         b=strcat(b,a1,tab,a2,tab,a3,tab,a4,"|")
  260.         goto ffloop
  261.         :ffshow
  262.         ItemSelect("Total Size=%tot%",b,"|")
  263.         :cancelfi
  264.         drop(a,tot,c,n,a1,a2,a3,a4,b)
  265.         Exit
  266. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  267. :DIRSIZE
  268.         tot = FileSize(FileItemize(""))
  269.         sub1 = DirItemize("")
  270.         if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  271.                                 then sub1=DirItemize("*.*")
  272.         totdir=0
  273.         level=1
  274.         dir1=DirGet()
  275.         numdir1 = ItemCount(sub1, " ")
  276.         index1 = 0
  277.   
  278.         :dsloop
  279.         If index%level% == numdir%level% Then Goto upalevel
  280.         index%level% = index%level% + 1
  281.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  282.         totdir=totdir+1
  283.         tot = tot + FileSize(FileItemize("*.*"))
  284.         level = level + 1
  285.         dir%level% = DirGet()
  286.         sub%level% = DirItemize("*.*")
  287.         numdir%level% = ItemCount(sub%level%, " ")
  288.         index%level% = 0
  289.         goto dsloop
  290.   
  291.         :upalevel
  292.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  293.         level=level-1
  294.         if level!=0 then goto dsloop
  295.  
  296.         ; -----------
  297.         ; Termination
  298.         ; -----------
  299.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  300.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  301.         tot = StrTrim(tot)
  302.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  303.         tot = StrTrim(tot)
  304.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  305.         tot = StrTrim(tot)
  306.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  307.         drop(tot,level,totdir)
  308.         Exit
  309.  
  310. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  311. :FONEBOOK
  312.         ; This code implements a phone dialer with WIL language statements.
  313.         ; The phone numbers are kept in the FONEBOOK.TXT file.  It is simply a text
  314.         ; file with name followed by number.  This code assumes everything after the
  315.         ; last space is part of the phone number.
  316.  
  317.         ; The code also assumes that the COM port has been correctly set up in the
  318.         ; PORTS section of the control panel.  Mostly be sure the Control Panel
  319.         ; ports section has the right baud rate for your modem in it.
  320.  
  321.         ; User initialization section.  Set these to correspond to your modem commands.
  322.         ; Most users will only have to check the ComPort setting.
  323.  
  324.         CancelCmd="goto CancelFB"
  325.         FBCancelCmd="Exit"
  326.         ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI")
  327.         OldFont=99
  328.         XPort=ComPort
  329.         if ComPort=="ASK" then XPort=AskLine("Phone Book","Enter modem COM port.%CR%If you have problems dialing, verify%CR%COM port setting in Windows Control Panel","COM1")
  330.         if XPort=="" then exit
  331.         if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI")
  332.                           then ComPort=XPort
  333.  
  334.         DialPrefix="ATDT"
  335.         HangCommand="ATH0"
  336.  
  337.         ; And here we go.  First make a CR/LF and a TAB
  338.         CR=strcat(num2char(13),num2char(10))
  339.         TAB=num2char(9)
  340.  
  341.         ; Use Home Directory
  342.         DirChange(DirHome())
  343.         ; Make sure there is a fonebook.txt file
  344.         if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE")
  345.                                       then FileWrite(fp,"Emergency Services      911")
  346.                                       then FileWrite(fp,"Directory Assistance    1-555-1212")
  347.                                       then FileClose(fp)
  348.  
  349.  
  350.         ; Put up the TextBox so the user can choose a number
  351.         :NewNum
  352.         FBCancelCmd="Exit"                   ; What to do if user hits "Cancel"
  353.         OldFont=IntControl(28,1,0,0,0)     ;Select fixed pitch font for textbox
  354.         num=StrTrim(TextBoxSort("DIALER - Just hit OK to add a new number","fonebook.txt"))
  355.         IntControl(28,OldFont,0,0,0)
  356.         if num!="" then goto zorkle
  357.  
  358.  
  359.  
  360.         num=strtrim(AskLine("DIALER","Enter name and number as in%CR%(Don't put any spaces in the number)","Joe Blough  1-555-1212"))
  361.         Terminate(num=="","","")
  362.         a=StrIndex(num," ",0,@BACKSCAN)
  363.         num2=strsub(num,a+1,strlen(num)-a)
  364.         num=strtrim(strsub(num,1,a-1))
  365.         num=strcat(strfix(num,' ',25),num2)
  366.         fp=FileOpen("temp876.num","WRITE")
  367.         FileWrite(fp,num)       ; send it the number to dial
  368.         FileClose(fp)
  369.         FileAppend("temp876.num","fonebook.txt")
  370.         FileDelete("temp876.num")
  371.         goto newnum
  372.  
  373.         :zorkle
  374.         a=StrIndex(num," ",0,@BACKSCAN)
  375.         b=Strindex(num,TAB,0,@BACKSCAN)
  376.         a=max(a,b)
  377.         num=strsub(num,a+1,strlen(num)-a)
  378.         DialCommand="%DialPrefix%%NUM%;"
  379.  
  380.  
  381.         :redial
  382.         fp=FileOpen(ComPort,"WRITE")
  383.         FileWrite(fp,"ATZ")        ; Send a CR to wake modem up
  384.         Delay(2)                   ; Let it get out of bed.
  385.         FileWrite(fp,DialCommand)
  386.         FileClose(fp)
  387.         Delay(3)                   ; Give modem a chance to think
  388.  
  389.         FBCancelCmd="Goto Hang1"
  390.         a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number")
  391.  
  392.         fp=FileOpen(ComPort,"WRITE")
  393.         FileWrite(fp,HangCommand)
  394.         FileClose(fp)
  395.  
  396.         if a==@YES then exit
  397.         Display(30,"Dialer","Redial Wait")
  398.         goto redial
  399.  
  400.         :CANCELFB
  401.         if OldFont!=99 then IntControl(28,OldFont,0,0,0)
  402.         %FBCancelCmd%
  403.  
  404.         :Hang1
  405.         fp=FileOpen(ComPort,"WRITE")
  406.         FileWrite(fp,HangCommand)
  407.         FileClose(fp)
  408.         goto NewNum
  409. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  410. :INIEDIT
  411.         DirChange(DirWindows(0))
  412.         CancelCmd="goto BYEBYE"
  413.         IniFiles=""
  414.         bSys386=0
  415.  
  416.         :UP1
  417.         CancelCmd="goto byebye"
  418.         If IniFiles!="" then goto inied
  419.         IniFiles=FileItemize("*.INI")
  420.         :inied
  421.         ButtonNames("&Edit File","&Quit")
  422.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  423.         if TheFile=="" then goto newini
  424.         Sections=""
  425.  
  426.         :UP2
  427.         CancelCmd="goto up1"
  428.         if Sections!="" then goto sected
  429.         Sections=IniItemizePvt("",TheFile)
  430.         :SECTED
  431.         ButtonNames("&Edit Section","&Up a Level")
  432.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  433.         if Section=="" then goto AddSect
  434.         if stricmp(Section,"386Enh")==0 then bSys386=1
  435.                                         else bSys386=0
  436.         KeyValues=""
  437.  
  438.         :UP3
  439.         CancelCmd="goto up2"
  440.         if KeyValues!="" then goto looped
  441.         Keys=IniItemizePvt(Section,TheFile)
  442.         if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
  443.                      then Keys=StrReplace(Keys,"Device%TAB%","")
  444.                      then Keys=StrReplace(Keys,"DEVICE%TAB%","")
  445.                      then Keys=StrReplace(Keys,"device","")
  446.                      then Keys=StrReplace(Keys,"Device","")
  447.                      then Keys=StrReplace(Keys,"DEVICE","")
  448.         KeyMax=ItemCount(Keys,TAB)
  449.         KeyIndex=0
  450.  
  451.         :ieLoop
  452.         if KeyIndex==KeyMax then goto looped
  453.         KeyIndex=KeyIndex+1
  454.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  455.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  456.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  457.         goto ieLoop
  458.  
  459.         :looped
  460.         ButtonNames("&Edit KeyWord","&Up a Level")
  461.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  462.         if Key=="" then goto AddKey
  463.         Key=ItemExtract(1,Key,"=")
  464.  
  465.         Value=IniReadPvt(Section,Key,"???",TheFile)
  466.         goto entkey
  467.  
  468.  
  469.         :newini
  470.         CancelCmd="goto UP1"
  471.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  472.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  473.         IniFiles=""
  474.         goto AddSectNewIni
  475.  
  476.         :AddSect
  477.         CancelCmd="goto up2"
  478.         :AddSectNewIni
  479.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  480.         Sections=""
  481.         goto AddKeyNewSect
  482.  
  483.         :AddKey
  484.         CancelCmd="goto up3"
  485.         :AddKeyNewSect
  486.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  487.         if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility")
  488.                                                  then goto AddKeyNewSect
  489.         Value="(Undefined)"
  490.         KeyValues=""
  491.         goto EntKeyNewKey
  492.  
  493.         :ENTKEY
  494.         CancelCmd="goto up3"
  495.         :EntKeyNewkey
  496.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  497.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  498.         KeyValues=""
  499.         goto up3
  500.  
  501.  
  502.         :BYEBYE
  503.         exit
  504. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  505. :SYSINFO
  506.        wintype="retail"
  507.        if WinMetrics(22) then wintype="debug"
  508.  
  509.         wc=WinConfig()
  510.         if !(wc&1) then mode="Real"
  511.         if wc&16 then mode="Standard"
  512.         if wc&32 then mode="Enhanced"
  513.  
  514.         if wc&2 then cpu=286
  515.         if wc&4 then cpu=386
  516.         if wc&8 then cpu=486
  517.         if wc&64 then cpu=8086
  518.         if wc&128 then cpu=80186
  519.  
  520.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  521.  
  522.         math="No math"
  523.         if wc&1024 then math="Math"
  524.         mouse="No Mouse"
  525.         if WinMetrics(19) then mouse="Mouse"
  526.  
  527.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  528.  
  529.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  530.  
  531.         ErrorMode(@OFF)
  532.         LastError()
  533.         PlayMedia("Status WaveForm Ready")
  534.         ErrorMode(@CANCEL)
  535.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  536.  
  537.         bug=NetGetCaps(2)
  538.         if bug==0 then math="No n"
  539.         if bug!=0 then math="N"
  540.         if bug==256 then math="Microsoft n"
  541.         if bug==512 then math="Lan Manager n"
  542.         if bug==768 then math="Novell NetWare n"
  543.         if bug==1024 then math="Banyan Vines n"
  544.         if bug==1280 then math="10 Net n"
  545.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  546.  
  547.         bug=WinResources(0)/1024   ; Compute memory avail
  548.         math=strlen(bug)
  549.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  550.  
  551.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  552.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  553.  
  554.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  555.         disks=DiskScan(1)
  556.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  557.         disks=DiskScan(2)
  558.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  559.         disks=DiskScan(4)
  560.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  561.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  562.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  563.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  564.  
  565.         ver=Version()
  566.         Message("%Param2% %ver% SysInfo",Sysinfo)
  567.         Exit
  568.  
  569. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  570. :ZIP
  571. :UNZIP
  572.     CancelCommand="goto ZZCANCEL"
  573.     ErrMsg=""
  574.     If !FileExist("wwwdos.bat")   Then ErrMsg="WWWDOS.BAT   not found"
  575.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  576.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  577.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  578.     If !FileExist("pkzip.exe")    Then ErrMsg="PKZIP.EXE    not found"
  579.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  580.     If !FileExist("browser.exe")  Then ErrMsg="BROWSER.EXE  not found"
  581.     If ErrMsg!="" Then Goto ShowError
  582.  
  583.         goto %param1%2     ; must be ZIP or UNZIP
  584.  
  585. :ZIP2
  586.         DaMove=" -a "
  587.         DaDirs=""
  588.         DaWho="*.*"
  589.         DaZip=""
  590.         DaRefresh=0
  591.         DaTitle="Files"
  592.         param3=strlower(param3)
  593.         if param3=="move" then DaMove=" -m "
  594.         goto %param2%         ; Must be CURRENT, DIR, SUBDIR, or HILITED
  595.  
  596. :CURRENT
  597.         DaWho=strcat(CurrentPath(),CurrentFile())
  598.         DaZip=strcat(FileRoot(DaWho),".ZIP")
  599.         goto ZIPDO
  600. :SUBDIR
  601.        DaDirs=" -r -p "
  602.        DaRefresh=1
  603.        DaTitle="Structure"
  604.        goto ZIPDO
  605.  
  606. :HILITED
  607.         b=FileItemize("")
  608.         If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  609.                  Then Goto ShowError
  610.         b=strreplace(b," ",CR)
  611.         fp=FileOpen("FC-TEMP9.XCV","WRITE")
  612.         FileWrite(fp,b)
  613.         FileClose(fp)
  614.         Drop(b)
  615.         DaWho="@FC-TEMP9.XCV"
  616.         goto ZIPDO
  617.  
  618. :DIR
  619.        DaTitle="Directory"
  620.        goto ZIPDO
  621.  
  622. :ZIPDO
  623.         DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  624.         if DaZip=="" then goto zzcancel
  625.         Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  626.         if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  627.         Refresh(DaRefresh)
  628.         Display(3,"Zip %DaTitle%","Complete")
  629.         goto zzcancel
  630.  
  631. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  632. :UNZIP2
  633.  
  634.        ViewFlag=0
  635.        zipsort=param3
  636.        goto %param2%    ; must be ALL, VIEW, or INDIV
  637.  
  638. :ALL
  639.         zipfile=strcat(CurrentPath(),CurrentFile())
  640.         if FileExtension(zipfile)=="ZIP" then goto alldoit
  641.         zipfile=FileItemize("*.zip")
  642.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  643.                  Then Goto ShowError
  644.         zipfile=itemselect("Select file to UnZip",zipfile," ")
  645.         if zipfile=="" then goto zzcancel
  646. :alldoit
  647.         if param3==2 then goto allspec
  648.         runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  649.         Refresh(1)
  650.         goto zzcancel
  651.  
  652. :allspec
  653.         RetHome="allspec1"
  654.         goto DoOptions
  655. :allspec1
  656.         if overwarn==0 then overwarn=" -o "
  657.                        else overwarn=""
  658.         RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  659.         Refresh(1)
  660.         goto zzcancel
  661.  
  662.  
  663.  
  664. :INDIV
  665.        ViewFlag=param3
  666.        if ViewFlag==1 then zipsort=1
  667.                       then overwarn=0
  668.                       then targdir=""
  669.                       then goto VIEW
  670.  
  671.         RetHome="VIEW"
  672.         goto DoOptions
  673.  
  674. :VIEW
  675.         workdir = Environment("TEMP")
  676.         If workdir == "" Then workdir = DirWindows(0)
  677.         If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  678.         if ViewFlag==0 then targdir=workdir
  679.         zipfile=strcat(CurrentPath(),CurrentFile())
  680.         if FileExtension(zipfile)=="ZIP" then goto viewdoit
  681.         zipfile=FileItemize("*.zip")
  682.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  683.                  Then Goto ShowError
  684.         if ViewFlag==0 then TSMsg="Select ZIP file to view"
  685.                        else TSMsg="Select ZIP file to use"
  686.         zipfile=itemselect(TSMsg,zipfile," ")
  687.         if zipfile=="" then goto zzcancel
  688.  
  689. :viewdoit
  690.         ziplist = StrCat(workdir, "wwwunzip.lst")
  691.         If FileExist(ziplist) Then FileDelete(ziplist)
  692.  
  693.         RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  694.         if ViewFlag==0 then TSMsg="Select file to view"
  695.                        else TSMsg="Select file to extract"
  696. :TXSEL
  697.         OldFont=IntControl(28,1,0,0,0)        ; Set fixed pitch font in text box
  698.         member=TextBox(TSMsg,ziplist)
  699.         IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  700.         if member=="" then goto ZZCANCEL
  701.  
  702.         member=strsub(member,46,strlen(member)-45)
  703.         memfile=FileExtension(member)
  704.         if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  705.                        else memfile=FileRoot(member)
  706.         
  707.  
  708.         if ViewFlag==0 then goto extract
  709.         if overwarn==0 then goto extract
  710.         If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  711.         b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  712.         If b == @NO Then Goto TXSEL
  713.  
  714. :extract
  715.         RunHideWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  716.         If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  717.                                            Then Goto ShowError
  718.  
  719.         if ViewFlag!=0 then TSMsg="Extract Another?"
  720.                        then goto TXSEL
  721.         member = StrUpper(StrCat(targdir, memfile))
  722.         RunZoomWait("browser.exe", member)
  723.         FileDelete(member)
  724.         TSMsg="View Another?"
  725.         goto TXSEL
  726.  
  727.  
  728. :SHOWERROR
  729.     Message("Error", ErrMsg)
  730.  
  731. :ZZCANCEL
  732.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  733.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  734.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  735.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  736.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  737.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  738.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  739.     exit
  740. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  741.  
  742. :DOOPTIONS
  743.         zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  744.         overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  745.         whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  746.  
  747.         ; Undocumented, new, beta dialog function being used here.  Will
  748.         ; be documented in the 2.0 release.  Good Luck.
  749.  
  750.  
  751.         ZippyFormat=`WWWDLGED,4.0`
  752.  
  753.         ZippyCaption=`Zip Options`
  754.     ZippyX=-1
  755.     ZippyY=-1
  756.     ZippyWidth=217
  757.     ZippyHeight=115
  758.     ZippyNumControls=13
  759.     Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  760.     Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  761.     Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  762.     Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  763.     Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  764.     Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  765.     Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  766.     Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  767.  
  768.     Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  769.     Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  770.     Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  771.     Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  772.     Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  773.  
  774.  
  775. :gettarg
  776.         ; Undocumented, new, beta dialog function being used here.  Will
  777.         ; be documented in the 2.0 release.  Good Luck.
  778.         ThisDir=DirGet()
  779.         targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  780.         Dialog("Zippy")
  781.  
  782.         if whichdir==1 then usecurdir = @YES
  783.                        then targdir=ThisDir
  784.                        else usecurdir = @NO
  785.         targdir = StrUpper(targdir)
  786.         If targdir == "" Then usecurdir = @YES
  787.                          Then targdir = DirGet()
  788.         If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  789.         If ThisDir==targdir then usecurdir = @YES
  790.                             then goto targok
  791.         DirChange(targdir)
  792.         CheckDir=DirGet()
  793.         DirChange(ThisDir)
  794.         If ThisDir!=CheckDir Then Goto targok
  795.  
  796.         b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  797.         If b == @NO Then Goto gettarg
  798.         DirMake(targdir)
  799.         DirChange(targdir)
  800.         CheckDir=DirGet()
  801.         DirChange(ThisDir)
  802.         If ThisDir!=CheckDir Then Goto targok
  803.         Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  804.         goto gettarg
  805.  
  806.         :targok
  807.         If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  808.         IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  809.         IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  810.         IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  811.         goto %RetHome%
  812. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  813. :CANCEL        ; This cancel is shared by ALL the above routines.
  814. %CancelCmd%    ; Execute Cancel Command
  815.